package com.larsgard.gedviewer.client.event;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.larsgard.gedviewer.shared.ProcessResult;

public class ProcessGedFileFinishedEvent extends
	GwtEvent<ProcessGedFileFinishedEvent.ProcessGedFileFinishedHandler> {

    public static final Type<ProcessGedFileFinishedHandler> TYPE = new Type<ProcessGedFileFinishedHandler>();

    public interface ProcessGedFileFinishedHandler extends EventHandler {
	public void onGedFileProcessed(ProcessGedFileFinishedEvent event);
    }

    private ProcessResult result;

    @Override
    protected void dispatch(ProcessGedFileFinishedHandler handler) {
	ProcessGedFileFinishedEvent event = new ProcessGedFileFinishedEvent();
	event.setResult(result);
	handler.onGedFileProcessed(event);
    }

    @Override
    public Type<ProcessGedFileFinishedHandler> getAssociatedType() {
	return TYPE;
    }

    public void setResult(ProcessResult result) {
	this.result = result;
    }

    public ProcessResult getResult() {
	return result;
    }
}
